import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:Smart/utils/screen_unit/gs_screen_util.dart';

class Toast {
  /// Toast 纯文本提示
  /// - text 字符串
  ///
  /// 示例：
  /// ``` dart
  /// Toast.showText("提示信息");
  /// ```
  static showText(String text) {
    BotToast.showCustomText(
        toastBuilder: (_) => LayoutBuilder(
              builder: (BuildContext context, BoxConstraints constraints) {
                return Container(
                    constraints: constraints.copyWith(
                      maxWidth: constraints.biggest.width * 0.9,
                    ),
                    padding:
                        EdgeInsets.symmetric(horizontal: 20.w, vertical: 11.w),
                    decoration: BoxDecoration(
                      color: Color(0xB3141413),
                      borderRadius: BorderRadius.circular(10),
                    ),
                    child: Text(
                      text,
                      style:
                          TextStyle(fontSize: 18.w, color: Color(0xFFFFFFFF)),
                      textAlign: TextAlign.center,
                    ));
              },
            ));
  }
}
